<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>

   function fn(){
     return request({
        method: 'post',
        url: '/sys/login',
        data
      })
   }
  //  fn().then().cacth()
  //  await后始终接收的是成功的结果
  // try 试着拿成功的结果, 如果拿不到就会进入catch
   try {
    const res = await fn()
   } catch (error) {
   }
  </script>
</body>
</html>